#! /usr/bin/env python

"""
(c) 2007 Alon Zakai ('Kripken') <kripkensteiner@gmail.com>

This software is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public
License along with this library; see the file COPYING
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""


import os

import ODMDB
import ODMFS

class ODM_main:
	def __init__(self, path_to_ODM, path_to_my_documents):
		print "Init:", path_to_ODM, path_to_my_documents

		self.base_ODM_path   = path_to_ODM
		self.path_to_DB      = path_to_ODM + os.sep + "DB"
		self.path_to_SVN     = path_to_ODM + os.sep + "svnrepo"
		self.path_to_storage = path_to_ODM + os.sep + "storage"

		self.path_to_my_documents = path_to_my_documents

		# Create the directories, if needed

#		if DB_NAME not in os.listdir(path_to_DB):
#			self.create_from_scratch(path_to_DB)

		# Init objects

		self.DB = ODMDB.ODMDB(self.path_to_DB)
		self.FS = ODMFS.ODMFS(self.path_to_my_documents)

	def main(self):
		self.FS.main()


############### MAIN ###############

ODM = ODM_main(os.path.expanduser("~") + os.sep + "ODM",
               os.path.expanduser("~") + os.sep + "Managed Documents")
ODM.main()
